<!-- 作业 -->
<script setup>
import { ref } from 'vue'
import { Search } from '@element-plus/icons-vue'
import { useRouter } from 'vue-router'
const router = useRouter()

const inputValue = ref('')
const serach = () => {
  console.log(inputValue.value)
}

const addHomework = () => {
  router.push('/spendNotice')
}
</script>
<template>
  <el-card class="my-card">
    <div class="header">
      <div>
        <el-button type="primary" round @click="addHomework">新建</el-button>
      </div>
      <el-input
        v-model="inputValue"
        :suffix-icon="Search"
        class="input-header"
        placeholder="搜索"
        @keyup.enter="serach"
      />
    </div>
    <div class="home">
      <HomeWork
        style="line-height: 60px; position: relative; top: 21px; margin-right: 10px"
      ></HomeWork>
      <a href="https://www.examcoo.com/editor/do/exam/id/120557" target="_blank">数据库平时练习</a>
    </div>
    <div class="home">
      <HomeWork
        style="line-height: 60px; position: relative; top: 21px; margin-right: 10px"
      ></HomeWork>
      <a href="https://www.examcoo.com/editor/do/exam/id/120531" target="_blank">数据库基础练习</a>
    </div>
  </el-card>
</template>

<style lang="scss" scoped>
.my-card {
  margin-top: 6.25rem;

  .header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.25rem;
    height: 3.75rem;
    border-bottom: 1px solid #e2e2e2;

    .input-header {
      width: 200px;

      :deep(.el-input__wrapper) {
        border-radius: 50px;
      }
    }
  }

  .home {
    height: 60px;
    border-bottom: 1px solid #ccc;
    display: flex;
    flex-direction: row;
    a {
      line-height: 60px;
      justify-items: center;
      align-items: center;
      text-decoration: none;
      color: black;
    }
    &:hover {
      background-color: #ebebeb;
      text-decoration: none;
      cursor: pointer;
    }
  }
}
</style>
